package com.gopay.common.domain.cloud;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;

/**
 * 对公鉴权信息表
 * lailingyu
 * 2017年11月29日 
 * www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "CLOUD_CORP_AUTHEN_INFO")
public class CloudCorpAuthenInfo implements Serializable {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -7969772567748174710L;

	/**
	 * 流水号
	 */
	private int transDtlSq;

	/**
	 * 国付宝交易号
	 */
	private String gopayOrderId;

	/**
	 * 企业名称
	 */
	private String entName;

	/**
	 * 企业标识
	 */
	private String entMark;

	/**
	 * 人员名称
	 */
	private String name;

	/**
	 * 个人识别码
	 */
	private String certNo;

	/**
	 * 结果代码
	 */
	private String code;

	/**
	 * 鉴权状态
	 */
	private String state;

	/**
	 * 鉴权描述
	 */
	private String detailDesc;

	/**
	 * 创建时间
	 */
	private Date createTs;

	/**
	 * 更新时间
	 */
	private Date lastUpdTs;

	@Id
	@Column(name = "TRANS_DTL_SQ", unique = true, nullable = false, length = 30)
	public int getTransDtlSq() {
		return transDtlSq;
	}

	public void setTransDtlSq(int transDtlSq) {
		this.transDtlSq = transDtlSq;
	}

	@Column(name = "GOPAY_ORDER_ID", nullable = false, length = 30)
	public String getGopayOrderId() {
		return gopayOrderId;
	}

	public void setGopayOrderId(String gopayOrderId) {
		this.gopayOrderId = gopayOrderId;
	}

	@Column(name = "ENT_NAME", nullable = false, length = 200)
	public String getEntName() {
		return entName;
	}

	public void setEntName(String entName) {
		this.entName = entName;
	}

	@Column(name = "ENT_MARK", nullable = false, length = 50)
	public String getEntMark() {
		return entMark;
	}

	public void setEntMark(String entMark) {
		this.entMark = entMark;
	}

	@Column(name = "NAME", nullable = false, length = 150)
	public String getName() {
		this.name = SensitiveInfoUtils.autoReencrypt(this.name);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.name);
	}

	public void setName(String name) {
		this.name = SensitiveInfoUtils.smartEncryptWithCheck(name);
	}

	@Column(name = "CERT_NO", nullable = false, length = 150)
	public String getCertNo() {
		this.certNo = SensitiveInfoUtils.autoReencrypt(this.certNo);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.certNo);
	}

	public void setCertNo(String certNo) {
		this.certNo = SensitiveInfoUtils.smartEncryptWithCheck(certNo);
	}

	@Column(name = "CODE", length = 5)
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "STATE", length = 1)
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "DETAIL_DESC", length = 200)
	public String getDetailDesc() {
		return detailDesc;
	}

	public void setDetailDesc(String detailDesc) {
		this.detailDesc = detailDesc;
	}

	@Column(name = "CREATE_TS", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreateTs() {
		return createTs;
	}

	public void setCreateTs(Date createTs) {
		this.createTs = createTs;
	}

	@Column(name = "LAST_UPD_TS")
	@Temporal(TemporalType.TIMESTAMP)
	public Date getLastUpdTs() {
		return lastUpdTs;
	}

	public void setLastUpdTs(Date lastUpdTs) {
		this.lastUpdTs = lastUpdTs;
	}

}
